/* eslint-disable */
// @ts-ignore
import request from '@/utils/request';
import { CustomRequestOptions } from '@/interceptors/request';

import * as API from './types';

/** 分页查询检测溯源信息 GET /product_inspection */
export async function productInspectionGetProductInspectionPage({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.ProductInspectionGetProductInspectionPageParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelResponseDataListModelProductInspectionModel_>(
    '/product_inspection',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 编辑溯源信息 PUT /product_inspection */
export async function productInspectionEditInspection({
  params,
  body,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.ProductInspectionEditInspectionParams;
  body: API.AddOrEditProductInspectionModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/product_inspection', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}

/** 上传溯源信息 POST /product_inspection */
export async function productInspectionUploadInspection({
  params,
  body,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.ProductInspectionUploadInspectionParams;
  body: API.AddOrEditProductInspectionModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/product_inspection', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}

/** Excel导出 GET /product_inspection/excel/export */
export async function productInspectionExcelExport({
  options,
}: {
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelListProductInspectionModel_>(
    '/product_inspection/excel/export',
    {
      method: 'GET',
      ...(options || {}),
    }
  );
}
